package algorithm.leetCode.threeNum;

public class ThreeNumSum {

	public static void main(String[] args) {
		int[] nums = { 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 6, 7 };
		int res = getNew(nums);
		System.out.println(res);
		for (int i = 0; i < res; i++)
			System.out.print(nums[i] + " ");
	}

	private static int getNew(int[] nums) {
		if (nums.length == 0)
			return 0;
		int num = 1, now = nums[0];
		for (int i = 0; i < nums.length; i++)
			if (nums[i] != now) {
				now = nums[i];
				nums[num++] = now;
			}
		return num;
	}

}
